!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("rb_wixui.thunderbolt[DropDownMenu_SolidColorMenuButtonSkin]",["react"],t):"object"==typeof exports?exports["rb_wixui.thunderbolt[DropDownMenu_SolidColorMenuButtonSkin]"]=t(require("react")):e["rb_wixui.thunderbolt[DropDownMenu_SolidColorMenuButtonSkin]"]=t(e.React)}("undefined"!=typeof self?self:this,(function(e){return function(){var t={5329:function(t){"use strict";t.exports=e},448:function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;te?{"data-comp":t,"data-aid":t}:{},u="wixui-",d=(e,...t)=>{const n=[];return e&&n.push(`${u}${e}`),t.forEach((e=>{e&&(n.push(`${u}${e}`),n.push(e))})),n.join(" ")},c=new Set(["PointerMenuButtonHorizontalMenuAdaptationSkin","PointerMenuButtonSkin","VerticalRibbonsMenuButtonSkin","RibbonsMenuButtonSkin"]),p="data-dropdown-shown",m="__more__",b="SCROLL_TO_TOP",h="SCROLL_TO_BOTTOM";var f={root:"dropdown-menu",menuItem:"dropdown-menu__item",subMenu:"dropdown-menu__submenu"};const v=e=>e.split("?")[0],k=(e,t)=>e.filter((e=>e.link&&e.link.linkPopupId&&e.link.linkPopupId===t)),y=(e,t,n)=>{const r=n.compId||n.dataId;let o=new Set;return r&&(o=new Set(e.filter((e=>((e,t,n)=>e.link&&(!e.link.href||v(e.link.href)===t)&&(e.link.anchorCompId&&e.link.anchorCompId===n.compId||e.link.anchorDataId&&e.link.anchorDataId===n.dataId&&e.link.anchorDataId!==b&&e.link.anchorDataId!==h))(e,t,n))))),o},g=function(e,t,n,r){void 0===e&&(e=[]),void 0===t&&(t=""),void 0===n&&(n={}),void 0===r&&(r="");const o=new Set([...Array.from(y(e,t,n)),...Array.from(k(e,r))]),a=o.size>0;return e.forEach((e=>{const i=e.items&&e.items.length?g(e.items,t,n,r):new Set;!1!==e.selected&&((e.selected||((e,t,n)=>!n&&!(e=>e.link&&(e.link.anchorDataId||e.link.anchorCompId))(e)&&e.link&&e.link.href&&decodeURIComponent(v(e.link.href))===t)(e,t,a)||e.link&&Object.keys(e.link).length>0&&i.size>0)&&o.add(e),i.forEach((e=>o.add(e))))})),o};function I(e,t){return""+e+t}function C(e,t){return e.filter(((e,n)=>{var r;const o=I(t,n.toString()),a=document.getElementById(o);return"hidden"===(null==a||null==(r=a.style)?void 0:r.visibility)}))}const w=e=>{const t=n.useMemo((()=>g(e.items,e.currentUrl,e.activeAnchor,e.currentPopupId)),[e.items,e.currentUrl,e.activeAnchor,e.currentPopupId]),r=(e,t)=>{const{Button:r}=e,o={...{onMouseEnter:e.onItemMouseEnter,onMouseLeave:e.onItemMouseLeave,onDoubleClick:e.onItemDblClick,onClick:e.onItemClick,textAlign:e.alignText},...t};return n.createElement(r,o)};function o(e,t,n,r,o,a){return e===t-1?1===t?"dropLonely":n?"bottom":a||"right"===o?r?"left":"right":"center":0===e?n?"top":a||"left"===o?r?"right":"left":"center":n?"dropCenter":"center"}const a=(e,t)=>{let n=e,r=0;for(;t[n]&&r<100;)n+=t[n]++,r++;return t[n]=(t[n]||0)+1,n},i=(e,n)=>{let{items:i=[],compClassName:l,dropdown:s,rtl:u,buttonAlign:d,stretch:c}=n;const p={};return i.map(((n,m)=>{var f,v,k;const y=(s?"moreContainer":"")+m,g={isContainer:s,isSelected:t.has(n),positionInList:n.positionInList||o(m,i.length,s,u,d,c),id:b(y),index:m,refInParent:y,isDropDownButton:s,"aria-haspopup":n.hasPopup||(null!=(f=null==n||null==(v=n.items)?void 0:v.length)?f:0)>0?"true":"false","aria-describedby":null!=n&&null!=(k=n.items)&&k.length?h():void 0,tagName:"li",direction:u?"rtl":"ltr",parentId:n.parent,dataId:n.id,label:n.label,link:n.link,compClassName:l,key:a(n.label,p),subItems:s?void 0:n.items};return r(e,g)}))};function s(e){const{styles:t,items:n,rtl:o,stretchButtonsToMenuWidth:a,alignButtons:s="center"}=e,u=i(e,{items:n,compClassName:l(t.menuItem,d(f.menuItem)),rtl:o,buttonAlign:s,stretch:a}),c=function(e){const{rtl:t,styles:n,stretchButtonsToMenuWidth:o,alignButtons:a="center",moreButtonLabel:i,onItemMouseEnter:l,onItemMouseLeave:s,onSubMenuKeyDown:u}=e,d=m;let c=t?"left":"right";o||"right"===a||(c="center");const p={label:i||"",isSelected:!1,positionInList:c,id:b(d),index:m,refInParent:d,key:d,onFocus:l,onBlur:s,"aria-haspopup":"true",tagName:"li",onKeyDown:u,isDropDownButton:!1,compClassName:n.moreButton,isMoreButton:!0};return r(e,p)}(e);return c&&u.push(c),u}function u(t){var r;const{alignButtons:o="center",onSubMenuKeyDown:a,hover:s,styles:u}=t,c=function(t){const{items:n,rtl:r,alignButtons:o="center",stretchButtonsToMenuWidth:a,hover:l,styles:s}=t;let u=null,d=[];if(n&&l){const t=parseInt(l,10);Number.isInteger(t)&&n[t]?u=n[t].items:l===m&&(u=function(e){return e.reduce(((e,t)=>{let n=[];return t.items&&(n=t.items.map((e=>({...e,parent:t.id})))),[...e,t,...n]}),[])}(C(n,e.id)))}return u&&(d=i(t,{items:u,compClassName:s.dropdownButton,dropdown:!0,rtl:r,buttonAlign:o,stretch:a})),d}(t),h=b("moreContainer"),v=b("dropWrapper"),k=(null!=(r=null==c?void 0:c.length)?r:0)>0,y=l(u.dropWrapper,{[u.showMore]:k}),g=k,I=function(e){const{hover:t,hoverListPosition:n}=e;return t?n:null}(t);return n.createElement("div",{className:y,id:v,"data-drophposition":I,"data-dropalign":o,[p]:g},n.createElement("ul",{className:l(u.moreContainer,d(f.subMenu)),"data-hover":s,id:h,onKeyDown:a},c))}const b=t=>I(e.id,t),h=()=>b("navContainer")+"-hiddenA11ySubMenuIndication";return function(e){const{translations:t,styles:r}=e,o=function(e){const{styles:t,skin:r,alignButtons:o="center",marginAllChildren:a,onMenuKeyDown:i}=e,u=s(e),d=b("itemsContainer");let c=n.createElement("ul",{className:l(t.itemsContainer,t[""+o]),id:d,style:{textAlign:o},"data-marginallchildren":a,onKeyDown:i},u);if((()=>{switch(r){case"IndentedMenuButtonSkin":case"ShinyMenuIIButtonSkin":case"SloppyBorderMenuButtonSkin":return!0;default:return!1}})()){const e=b("wrapper");c=n.createElement("div",{className:l(t.itemsContainerWrapper),id:e},c)}return c}(e),a=function(e){const{skin:t,styles:r}=e;let o=null;return c.has(t)&&(o=n.createElement("div",{className:r.utility})),o}(e),i=u(e),d=b("navContainer");return n.createElement("nav",{className:l(r.navContainer),id:d,"aria-label":t.ariaLabel,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave},a,o,i,(p=t.subMenuIndication,n.createElement("div",{style:{display:"none"},id:h()},p)));var p}(e)},M={hover:null,hoverListPosition:null};var S=e=>{const[r,o]=n.useState(M),a=n.useRef();let i;const u=t=>{var n;const{hover:o}=r,{id:a,items:i}=e,l=t.getAttribute("data-index")||"-1",s=parseInt(l,10);if((null==t||null==(n=t.parentNode)?void 0:n.id)!==a+"moreContainer")return i[s];if(!o)return null;if(o===m){return C(i,a)[s]}return i[parseInt(o,10)].items[s]},c=t=>{const{onItemMouseIn:n}=e,{currentTarget:r}=t;null==n||n(t,u(r)),p(t)},p=t=>{var n;const{hover:a}=r,{id:l}=e,{currentTarget:s}=t,u=s.getAttribute("data-listposition"),d=s.getAttribute("data-index")||"-1",c=parseInt(d,10);clearTimeout(i);(null==s||null==(n=s.parentNode)?void 0:n.id)!==l+"moreContainer"&&(Number.isInteger(c)&&-1!==c||d.startsWith("__"))&&d!==a&&o({hover:d,hoverListPosition:u})},b=t=>{const{onItemMouseOut:n}=e,{currentTarget:r}=t;null==n||n(t,u(r)),h()},h=()=>{i=setTimeout((()=>{o({hover:null,hoverListPosition:null})}),1e3)},v=t=>{const{onItemDblClick:n}=e,{currentTarget:r}=t;null==n||n(t,u(r))},k=t=>{const{hover:n}=r,{currentTarget:o}=t,{items:a,onItemClick:i,isTouchDevice:l}=e;if(null==i||i(t,u(o)),l){var s;const e=o.getAttribute("data-index")||"-1",r="true"===o.getAttribute("data-dropdown"),i=parseInt(e,10),l=a?a[i]:null,u=e===m||(null==l||null==(s=l.items)?void 0:s.length)>0;r?h():n?(h(),u&&n!==e&&(t.preventDefault(),t.stopPropagation(),p(t))):u&&(p(t),t.preventDefault(),t.stopPropagation())}},y=function(t,n){if(void 0===n&&(n=!1),a.current){const{id:o}=e;let i=a.current.querySelector("#"+o+"itemsContainer > li:nth-child("+(t+1)+")");for(;i&&"true"===i.getAttribute("aria-hidden");)i=n?i.previousSibling:i.nextSibling;if(i){var r;const e=null==(r=i.childNodes)?void 0:r[0];if(e)return e.focus(),!0}}return!1},g=t=>{const{hover:n}=r,{items:o}=e,{key:i,shiftKey:l}=t;if("Tab"===i&&null!==n){const r=n?parseInt(n,10):-1;let i=!1;if(!l&&o){const t=o[r];t&&t.items&&(i=(t=>{const{id:n}=e;if(a.current){const e=a.current.querySelector("#"+n+"moreContainer li:nth-child("+(t+1)+") a");if(e)return e.focus(),!0}return!1})(0))}i&&(t.stopPropagation(),t.preventDefault())}},I=t=>{const{hover:n}=r,{items:o}=e,{shiftKey:a,key:i,target:l,currentTarget:s}=t;let u=l;if(l!==s&&"li"!==l.tagName.toLowerCase()&&(u=l.closest("li")),u){const e=u.getAttribute("data-index")||"";let r=!1;if(n&&"Tab"===i){const t=((e,t)=>{const n=parseInt(e,10);return Number.isNaN(n)?t:n})(n,-1),i=parseInt(e,10);if(t>=0)if(a)0===i&&(r=y(t,a));else if(o&&o[t]){const e=o[t];e&&e.items&&e.items.length===i+1&&(r=y(t+1))}}r&&(t.stopPropagation(),t.preventDefault())}};function S(e,t){const{hover:n,hoverListPosition:r}=t,{stretchButtonsToMenuWidth:o,sameWidthButtons:a,skinExports:i,alignButtons:l="center",items:u,isQaMode:d,fullNameCompType:c}=e;return{"data-stretch-buttons-to-menu-width":o,"data-same-width-buttons":a,"data-num-items":null==u?void 0:u.length,"data-menuborder-y":i.menuBorderY,"data-menubtn-border":i.menuBtnBorder,"data-ribbon-els":i.ribbonEls,"data-label-pad":i.labelPad,"data-ribbon-extra":i.ribbonExtra,"data-drophposition":r,"data-dropalign":l,"data-hovered-item":n,...s(d,c)}}return function(r,o){const{id:i,className:s,customClassNames:u=[],skin:p,rtl:m,styles:h}=r,y={id:i,class:l(h[p],h.wrapper,s,d(f.root,...u),"hidden-during-prewarmup"),ref:a,tabIndex:-1,dir:m?"rtl":"ltr",...S(r,o)};return n.createElement("wix-dropdown-menu",y,n.createElement(w,t()({},r,o,{onItemMouseEnter:e.isTouchDevice?void 0:c,onItemMouseLeave:e.isTouchDevice?void 0:b,onItemDoubleClick:e.onItemDblClick?v:void 0,onItemClick:e.isTouchDevice||e.onItemClick?k:void 0,onMenuKeyDown:g,onSubMenuKeyDown:I})))}(e,r)};const x=13,B=27;function D(e){return t=>{t.keyCode===e&&(t.preventDefault(),t.stopPropagation(),t.currentTarget.click())}}const N=D(32),E=D(x),P=e=>{E(e),N(e)},L=(D(B),e=>Object.entries(e).reduce(((e,[t,n])=>(t.includes("data-")&&(e[t]=n),e)),{}));const _={root:"linkElement"},A=(e,r)=>{const{href:o,role:a,target:i,rel:l,className:s="",children:u,linkPopupId:d,anchorDataId:c,anchorCompId:p,tabIndex:m,dataTestId:b=_.root,title:h,onClick:f,onDoubleClick:v,onMouseEnter:k,onMouseLeave:y,onFocus:g,onFocusCapture:I,onBlurCapture:C,"aria-live":w,"aria-disabled":M,"aria-label":S,"aria-labelledby":x,"aria-pressed":B,"aria-expanded":D,"aria-describedby":A,"aria-haspopup":T,"aria-current":O,dataPreview:j,dataPart:K}=e,W=void 0!==e.activateByKey?e.activateByKey:(e=>e?"SpaceOrEnter":"Space")(d);let R;switch(W){case"Enter":R=E;break;case"Space":R=N;break;case"SpaceOrEnter":R=P;break;default:R=void 0}return void 0!==o||d?n.createElement("a",t()({},L(e),{"data-testid":b,"data-popupid":d,"data-anchor":c,"data-anchor-comp-id":p,"data-preview":j,"data-part":K,href:o||void 0,target:i,role:d?"button":a,rel:l,className:s,onKeyDown:R,"aria-live":w,"aria-disabled":M,"aria-label":S,"aria-labelledby":x,"aria-pressed":B,"aria-expanded":D,"aria-haspopup":T,"aria-describedby":A,"aria-current":O,title:h,onClick:f,onMouseEnter:k,onMouseLeave:y,onDoubleClick:v,onFocus:g,onFocusCapture:I,onBlurCapture:C,ref:r,tabIndex:d?0:m}),u):n.createElement("div",t()({},L(e),{"data-testid":b,"data-preview":j,"data-part":K,className:s,tabIndex:m,"aria-label":S,"aria-labelledby":x,"aria-haspopup":T,"aria-disabled":M,"aria-expanded":D,title:h,role:a,onClick:f,onDoubleClick:v,onMouseEnter:k,onMouseLeave:y,ref:r}),u)};var T=n.forwardRef(A);var O=e=>{let{wrapperProps:{ariaHasPopup:n,isMoreButton:r,ariaDescribedBy:o},className:i,children:l,link:s,tabIndex:u}=e;return a().createElement(T,t()({},s,{"aria-haspopup":n,"aria-describedby":o,tabIndex:u||(!r&&s&&s.href?void 0:0),className:i}),l)};const j=e=>{let{dir:t,textAlign:n,className:r,children:o,tagName:i="p",id:l}=e;return a().createElement(i,{className:r,style:{textAlign:n},dir:t,id:l+"label"},o)};var K=e=>{let{wrapperProps:{dir:t,textAlign:n,id:r},classNames:o,children:i}=e;return a().createElement("div",{className:l(o.bg),style:{textAlign:n}},a().createElement(j,{dir:t,textAlign:n,className:o.label,id:r},i))};var W=e=>{const{label:r,direction:o="ltr",positionInList:a,parentId:i,dataId:s,isContainer:u,isSelected:d,isHovered:c,link:p,tagName:m="div",id:b,className:h,compClassName:f,onClick:v,onDoubleClick:k,onMouseEnter:y,onMouseLeave:g,index:I,children:C,isDropDownButton:w,subItems:M}=e,S=[u?"drop":"menu",d&&"selected",c&&"over",p&&(p.hasOwnProperty("href")||p.hasOwnProperty("target")||p.hasOwnProperty("rel")||p.hasOwnProperty("linkPopupId"))?"link":"header"],x={...L(e),"data-direction":o,"data-listposition":a,"data-parent-id":i,"data-data-id":s,"data-state":S.join(" "),"data-index":I,"data-dropdown":w},B=e=>e?e.trim():"\xa0",D=M&&M.length?n.createElement("ul",{"aria-hidden":!0,style:{display:"none"}},M.map(((e,t)=>n.createElement("li",{key:e.id||t},n.createElement(O,{wrapperProps:{ariaHasPopup:e.hasPopup},link:e.link,tabIndex:-1,compClassName:f},B(e.label)))))):null;return n.createElement(m,t()({id:b},x,{className:l(f,h),onClick:v,onDoubleClick:k,onMouseEnter:y,onMouseLeave:g,onFocus:y,onBlur:g}),C(B(r)),D)};var R=e=>{const{id:r,isDropDownButton:o,"aria-haspopup":a,"aria-describedby":i,isMoreButton:s,dir:u,textAlign:d,positionInList:c,link:p,skinsStyle:m,skin:b}=e;return n.createElement(W,t()({},e,{className:l(e.className,m[b])}),(e=>n.createElement(O,{wrapperProps:{positionInList:c,ariaHasPopup:o?a:"false",ariaDescribedBy:i,isMoreButton:s},link:p,className:m.linkElement},n.createElement("div",{className:m.wrapper},n.createElement(K,{wrapperProps:{dir:u,textAlign:d,id:r},classNames:{bg:m.bg,label:m.label}},e)))))},U={root:"I2NxvL",SolidColorMenuButtonNSkin:"ULfND1",solidColorMenuButtonNSkin:"ULfND1",linkElement:"piclkP",wrapper:"ktxcLB",label:"JghqhY"};var F=e=>n.createElement(R,t()({},e,{skinsStyle:U,skin:"SolidColorMenuButtonNSkin"})),H={wrapper:"eK3b7p",navContainer:"dX73bf",itemsContainerWrapper:"ShB2o6",itemsContainer:"LtxuwL",menuItem:"SUHLli",dropdownButton:"bNFXK4",dropWrapper:"QQFha4",moreContainer:"vZwEg5",showMore:"_0uaYC",moreButton:"xu0rO4",utility:"V4qocw",SolidColorMenuButtonSkin:"HYblus",solidColorMenuButtonSkin:"HYblus"};const q=(e,r)=>n.createElement(S,t()({},e,{ref:r,styles:H,Button:F}));const Y=e=>e.replace(/([A-Z])/g,(e=>`-${e.toLowerCase()}`));var $;const V={DropDownMenu_SolidColorMenuButtonSkin:{component:n.forwardRef(q),controller:($=e=>{let{stateValues:t,mapperProps:n}=e;const{currentUrl:r}=t;return{...n,currentUrl:r}},{useComponentProps:(e,t,n)=>{const r=(e=>({...e,updateStyles:t=>{const n=Object.entries(t).reduce(((e,[t,n])=>{return{...e,[(r=t,r.startsWith("--")?t:Y(t))]:void 0===n?null:n};var r}),{});e.updateStyles(n)}}))(n);return $({mapperProps:e,stateValues:t,controllerUtils:r})}})}}}(),o}()})); //# sourceMappingURL=https://static.parastorage.com/services/editor-elements-library/dist/thunderbolt/rb_wixui.thunderbolt[DropDownMenu_SolidColorMenuButtonSkin].ce39e99c.bundle.min.js.map